﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TimeApp
{

    public class TextAndValue
    {
        //使用方法，也可以使用List
        //ArrayList al = new ArrayList();
        //al.Add(new TextAndValue("张三","zs10111"));
        //al.Add(new TextAndValue("李四", "ls10253"));
        //al.Add(new TextAndValue("阿拉蕾", "A20876"));
        //comboBox1.DataSource = al;
        //comboBox1.DisplayMember = "DisplayText";
        //comboBox1.ValueMember = "RealValue";

        private Object _RealValue = "";
        private String _DisplayText = "";

        public String DisplayText
        {
            get
            {
                return _DisplayText;
            }
        }

        public Object RealValue
        {
            get
            {
                return _RealValue;
            }
        }

        public TextAndValue(String ShowText, Object RealVal)
        {
            _DisplayText = ShowText;
            _RealValue = RealVal;
        }

        public override string ToString()
        {
            return _RealValue.ToString();
        }
    }
}